package cn.innosmart.aq.view.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;

import cn.innosmart.aq.R;
import cn.innosmart.aq.view.activity.base.BaseActivity;
import cn.innosmart.aq.view.fragment.CountLoginFragment;

/**
 * Created by David on 2015/7/15.
 */
public class CountActivity extends BaseActivity {
    private int flag = -1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_count);
        Intent intent = getIntent();
        flag = intent.getIntExtra("flag", -1);
        swichCountLoginFragment();
    }

    public void swichCountLoginFragment() {
        CountLoginFragment fragment;
        FragmentManager fm = getSupportFragmentManager();
        fragment = (CountLoginFragment) fm.findFragmentByTag("countlogin");
        if (fragment == null) {
            fragment = new CountLoginFragment();
        }
        FragmentTransaction tx = fm.beginTransaction();
        tx.replace(R.id.ll_content, fragment, "countlogin");
        tx.commit();
    }


    @Override
    protected void onResume() {
        setBaseDialogContext(this);
        super.onResume();
    }
}
